﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class SceneLoadingPanel : MonoBehaviour
{
    public Text m_ProcessText;
    public int process{set{ m_ProcessText.text = "场景加载中:"+value.ToString()+"%"; }}
    private void Awake()
    {
    }

    void Start()
    {
        
    }
    float starting = -1;
    // Update is called once per frame
    void Update()
    {
        if(starting <= 1)
        {
            starting += (Time.unscaledDeltaTime * 2);
            var background = GetComponent<Image>();
            if (background)
            {
                var backColor = background.color;
                background.color = new Color(backColor.r, backColor.g, backColor.b, starting);
            }
        }
    }
    public void StartLoad()
    {
        starting = 0;
    }
}
